home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / GNU / GNUPLOTsrc.lha / term / aed.trm next >
Encoding:
Text File  |  1996-01-22  |  4.5 KB  |  201 lines

  1. /*
  2.  * $Id: aed.trm,v 1.6 1995/12/20 21:47:38 drd Exp $
  3.  *
  4.  */
  5.  
  6. /* GNUPLOT - aed.trm */
  7. /*
  8.  * Copyright (C) 1990 - 1993
  9.  *
  10.  * Permission to use, copy, and distribute this software and its
  11.  * documentation for any purpose with or without fee is hereby granted, 
  12.  * provided that the above copyright notice appear in all copies and 
  13.  * that both that copyright notice and this permission notice appear 
  14.  * in supporting documentation.
  15.  *
  16.  * Permission to modify the software is granted, but not the right to
  17.  * distribute the modified code.  Modifications are to be distributed 
  18.  * as patches to released version.
  19.  *  
  20.  * This software  is provided "as is" without express or implied warranty.
  21.  * 
  22.  * This file is included by ../term.c.
  23.  *
  24.  * This terminal driver supports:
  25.  *   AED terminals
  26.  *
  27.  * AUTHORS
  28.  *     Colin Kelley, Thomas Williams, Russell Lang
  29.  *
  30.  * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  31.  * 
  32.  */
  33.  
  34. /*
  35.  * adapted to the new terminal layout by Stefan Bodewig (Dez. 1995)
  36.  */
  37.  
  38. #ifndef GOT_DRIVER_H
  39. #include "driver.h"
  40. #endif
  41.  
  42. #ifdef TERM_REGISTER
  43. register_term(aed512)
  44. register_term(aed767)
  45. #endif
  46.  
  47. #ifdef TERM_PROTO
  48. TERM_PUBLIC void AED_init __P((void));
  49. TERM_PUBLIC void AED_graphics __P((void));
  50. TERM_PUBLIC void AED_text __P((void));
  51. TERM_PUBLIC void AED_linetype __P((int linetype));
  52. TERM_PUBLIC void AED_move __P((unsigned int x, unsigned int y));
  53. TERM_PUBLIC void AED_vector __P((unsigned int x, unsigned int y));
  54. TERM_PUBLIC void AED_put_text __P((unsigned int x, unsigned int y, char str[]));
  55. TERM_PUBLIC void AED_reset __P((void));
  56.  
  57. #define AED_XMAX 768
  58. #define AED_YMAX 575
  59.  
  60. #define AED_VCHAR    13
  61. #define AED_HCHAR    8
  62. #define AED_VTIC    8
  63. #define AED_HTIC    7
  64.  
  65. /* slightly different for AED 512 */
  66. #define AED5_XMAX 512
  67. #endif
  68.  
  69. #ifndef TERM_PROTO_ONLY
  70. #ifdef TERM_BODY
  71.  
  72. #define AED_XLAST (AED_XMAX - 1)
  73. #define AED_YLAST (AED_YMAX - 1)
  74.  
  75. #define AED5_XLAST (AED5_XMAX - 1)
  76.  
  77. TERM_PUBLIC void AED_init()
  78. {
  79.     fprintf(outfile,
  80.     "\033SEN3DDDN.SEC.7.SCT.0.1.80.80.90.SBC.0.AAV2.MOV.0.9.CHR.0.FFD");
  81. /*   2            3     4                5     7    6       1
  82.     1. Clear Screen
  83.     2. Set Encoding
  84.     3. Set Default Color
  85.     4. Set Backround Color Table Entry
  86.     5. Set Backround Color
  87.     6. Move to Bottom Lefthand Corner
  88.     7. Anti-Alias Vectors
  89. */
  90. }
  91.  
  92.  
  93. TERM_PUBLIC void AED_graphics()
  94. {
  95.     fprintf(outfile,"\033FFD\033");
  96. }
  97.  
  98.  
  99. TERM_PUBLIC void AED_text()
  100. {
  101.     fprintf(outfile,"\033MOV.0.9.SEC.7.XXX");
  102. }
  103.  
  104.  
  105.  
  106. TERM_PUBLIC void AED_linetype(linetype)
  107. int linetype;
  108. {
  109. static int color[2+9] = { 7, 1, 6, 2, 3, 5, 1, 6, 2, 3, 5 };
  110. static int type[2+9] = { 85, 85, 255, 255, 255, 255, 255, 85, 85, 85, 85 };
  111.  
  112.     if (linetype >= 10)
  113.         linetype %= 10;
  114.     fprintf(outfile,"\033SLS%d.255.",type[linetype+2]);
  115.     fprintf(outfile,"\033SEC%d.",color[linetype+2]);
  116. }
  117.  
  118.  
  119.  
  120. TERM_PUBLIC void AED_move(x,y)
  121. unsigned int x,y;
  122. {
  123.     fprintf(outfile,"\033MOV%d.%d.",x,y);
  124. }
  125.  
  126.  
  127. TERM_PUBLIC void AED_vector(x,y)
  128. unsigned int x,y;
  129. {
  130.     fprintf(outfile,"\033DVA%d.%d.",x,y);
  131. }
  132.  
  133.  
  134. TERM_PUBLIC void AED_put_text(x,y,str)
  135. unsigned int x,y;
  136. char str[];
  137. {
  138.     AED_move(x,y - AED_VCHAR/2 + 2);
  139.     fprintf(outfile,"\033XXX%s\033",str);
  140. }
  141.  
  142.  
  143. #define hxt (AED_HTIC/2)
  144. #define hyt (AED_VTIC/2)
  145.  
  146. TERM_PUBLIC void AED_reset()
  147. {
  148.     fprintf(outfile,"\033SCT0.1.0.0.0.SBC.0.FFD");
  149. }
  150.  
  151. #endif /* TERM_BODY */
  152.  
  153. #ifdef TERM_TABLE
  154. TERM_TABLE_START(aed512_driver)
  155.     "aed512", "AED 512 Terminal",
  156.        AED5_XMAX, AED_YMAX, AED_VCHAR, AED_HCHAR,
  157.        AED_VTIC, AED_HTIC, options_null, AED_init, AED_reset, 
  158.        AED_text, null_scale, AED_graphics, AED_move, AED_vector, 
  159.        AED_linetype, AED_put_text, null_text_angle, 
  160.        null_justify_text, do_point, do_arrow, set_font_null
  161. TERM_TABLE_END(aed512_driver)
  162. #undef LAST_TERM
  163. #define LAST_TERM aed512_driver
  164.  
  165. TERM_TABLE_START(aed767_driver)
  166.     "aed767", "AED 767 Terminal",
  167.        AED_XMAX, AED_YMAX, AED_VCHAR, AED_HCHAR,
  168.        AED_VTIC, AED_HTIC, options_null, AED_init, AED_reset, 
  169.        AED_text, null_scale, AED_graphics, AED_move, AED_vector, 
  170.        AED_linetype, AED_put_text, null_text_angle, 
  171.        null_justify_text, do_point, do_arrow, set_font_null
  172. TERM_TABLE_END(aed767_driver)
  173. #undef LAST_TERM
  174. #define LAST_TERM aed767_driver
  175.  
  176. #endif /* TERM_TABLE */
  177. #endif /* TERM_PROTO_ONLY */
  178.  
  179. /*
  180.  * NAME: aed512
  181.  *
  182.  * OPTIONS: none
  183.  *
  184.  * SUPPORTS: AED 512 Terminals
  185.  *
  186.  * Further Info: Looks like a plain graphics terminal driver, nothing
  187.  *         special.
  188.  */
  189. /*
  190.  * NAME: aed767
  191.  *
  192.  * OPTIONS: none
  193.  *
  194.  * SUPPORTS: AED 767 Terminals
  195.  *
  196.  * Further Info: Also looks like a plain graphics terminal driver, nothing
  197.  *         special either. Only difference to aed512 is the
  198.  *         horizontal range.
  199.  *
  200.  */
  201.